﻿/*
ParallelPlatform Project - A web platform to distribute and share knowledge
Online Editor - An online tool to create and play animations
Copyright (C) 2011 Daniel Guerrero Martínez & Sergio Rodríguez Lumley

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package Classes{

	import flash.events.MouseEvent;
	import flash.events.KeyboardEvent;
	
	public class CanvasDefaultHandler implements CanvasHandlerInterface{
		var activated:Boolean;
		var shapeToCreate:String;
		var core:CanvasCore;
		
		public function CanvasDefaultHandler(c:CanvasCore){
			activated = false;
			core = c;
		}
		
		/**
		  This handler has been selected
		  @param param Parameter that could be needed for the handler (may not be used)
		*/
		public function activate(param = null):void{
			if(! activated){
				activated = true;
				core.showBlockPanel(true);
				if(param != null) shapeToCreate = param;
				core.removeSelections();
			}
		}
		
		/**
		  Another handler has been selected, remove all unnecessary data
		*/
		public function deactivate():void{
			activated = false;
		}
		
		/**
		  Checks whether it is possible to undo or redo, this is only
		  for stetical purposes
		*/
		public function checkUndoRedo():void{
			
		}
		
		/**
		  Back panel has been clicked
		*/
		public function clickBack(evt:MouseEvent):void{
			
		}
		
		/**
		  Front panel has been clicked
		*/
		public function clickFront(evt:MouseEvent):void{
			
		}
		
		/**
		  A shape has been clicked
		*/
		public function clickShape(evt:MouseEvent, obj:ShapeObject, type:int):void{
			
		}
		
		/**
		  Indicates if this handler keeps a record of the actions it is doing
		*/
		public function hasRecord():Boolean{
			return false;
		}
		
		/**
		  A key has been pressed
		  Ctrl+Z, Ctrl+Y and Ctrl+S are excluded from here
		*/
		public function keyPressed(evt:KeyboardEvent):void{
			
		}
		
		/**
		  Mouse is moving
		*/
		public function mouseMove(evt:MouseEvent):void{
			
		}
		
		/**
		  Mouse button has been released
		*/
		public function mouseUp(evt:MouseEvent):void{
			
		}
		
		/**
		  Redoes the last undone action (if there is one)
		*/
		public function redo():void{
			
		}
		
		/**
		  Undoes the last undone action (if there is one)
		*/
		public function undo():void{
			
		}
	}
}